package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class IODemo9 {
    public static void main(String[] args) {
        // 如果后面不跟true 下次打开就会重置里面的，如果跟了true只会在后面增加
        // 以字节为单位惊醒读写，一次最少读写一个字节
        try(OutputStream outputStream = new FileOutputStream("./test.txt",true)){
            byte[] buffer = new byte[]{97,98,99,100};
            outputStream.write(buffer);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
